﻿
using CSharpLibs.Annotations;

namespace System
{
	[Builtin]
	public static class Math
	{
		public const double E = 2.71;
		public const double PI = 3.14;

		public static short Abs(short x)
		{ return (short)((x < 0) ? -x : x); }

		public static int Abs(int x)
		{ return (x < 0) ? -x : x; }

		public static long Abs(long x)
		{ return (x < 0) ? -x : x; }

		public static float Abs(float x)
		{ return (x < 0) ? -x : x; }

		public static double Abs(double x)
		{ return (x < 0) ? -x : x; }

		public static float Ceiling(float x)
		{ return (float)Ceiling((double)x); }

		[BuiltinMethod, BuiltinSemantics("ceiling_double")]
		public static double Ceiling(double x)
		{ return 1.0; }

		public static float Floor(float x)
		{ return (float)Floor((double)x); }

		[BuiltinMethod, BuiltinSemantics("floor_double")]
		public static double Floor(double x)
		{ return 1.0; }

		public static float Log(float x)
		{ return (float)Log((double)x); }

		[BuiltinMethod, BuiltinSemantics("log_double")]
		public static double Log(double x)
		{ return 1.0; }

		public static char Max(char x, char y)
		{ return (x > y) ? x : y; }

		public static byte Max(byte x, byte y)
		{ return (x > y) ? x : y; }

		public static short Max(short x, short y)
		{ return (x > y) ? x : y; }

		public static ushort Max(ushort x, ushort y)
		{ return (x > y) ? x : y; }

		public static int Max(int x, int y)
		{ return (x > y) ? x : y; }

		public static uint Max(uint x, uint y)
		{ return (x > y) ? x : y; }

		public static long Max(long x, long y)
		{ return (x > y) ? x : y; }

		public static float Max(float x, float y)
		{ return (x > y) ? x : y; }

		public static double Max(double x, double y)
		{ return (x > y) ? x : y; }

		public static char Min(char x, char y)
		{ return (x < y) ? x : y; }

		public static byte Min(byte x, byte y)
		{ return (x < y) ? x : y; }

		public static short Min(short x, short y)
		{ return (x < y) ? x : y; }

		public static ushort Min(ushort x, ushort y)
		{ return (x < y) ? x : y; }

		public static int Min(int x, int y)
		{ return (x < y) ? x : y; }

		public static uint Min(uint x, uint y)
		{ return (x < y) ? x : y; }

		public static long Min(long x, long y)
		{ return (x < y) ? x : y; }

		public static float Min(float x, float y)
		{ return (x < y) ? x : y; }

		public static double Min(double x, double y)
		{ return (x < y) ? x : y; }

		public static float Pow(float x, float y)
		{ return (float)Pow((double)x, (double)y); }

		[BuiltinMethod, BuiltinSemantics("pow_double")]
		public static double Pow(double x, double y)
		{ return 1.0; }

		public static float Sqrt(float x)
		{ return (float)Sqrt((double)x); }

		[BuiltinMethod, BuiltinSemantics("sqrt_double")]
		public static double Sqrt(double x)
		{ return 1.0; }

		public static float Sin(float x)
		{ return (float)Sin((double)x); }

		[BuiltinMethod, BuiltinSemantics("sin_double")]
		public static double Sin(double x)
		{ return 1.0; }

		public static float Cos(float x)
		{ return (float)Cos((double)x); }

		[BuiltinMethod, BuiltinSemantics("cos_double")]
		public static double Cos(double x)
		{ return 1.0; }

		public static float Tan(float x)
		{ return (float)Tan((double)x); }

		[BuiltinMethod, BuiltinSemantics("tan_double")]
		public static double Tan(double x)
		{ return 1.0; }
	}
}
